
const presets = [
    ['@babel/preset-env', { 
            "loose": true, 
            modules: false,
            //useBuiltIns:'usage',
            useBuiltIns:'entry',
            corejs:3
        } 
    ],
    ["@vue/babel-preset-jsx"]
]

const plugins = [
    //['@babel/plugin-transform-runtime', { corejs: 3 }], "@babel/runtime-corejs3": "^7.8.7",
    ['@babel/plugin-transform-runtime'],
    '@babel/plugin-syntax-dynamic-import',
    '@babel/plugin-syntax-jsx',
    '@babel/plugin-transform-modules-commonjs',
    ["component", {
        "libraryName": "element-ui",
        "styleLibraryName": "theme-chalk"
    }]
]

if( process.env.NODE_ENV == 'development' ){

    // console.log('\nadd import plugin')
    // plugins.push(["import", {
    //     "libraryName": "xzui",
    //     "libraryDirectory": "packages",
    //     //styleLibraryDirectory:'styles',
    //     style: 'css'
    // }])
    
}

module.exports = { presets, plugins }
